﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using HP.Cachalote.DataModels;
using HP.Cachalote.Repositories.Interfaces;

namespace HP.Cachalote.Repositories.EntityFramework
{
    /// <summary>
    /// An instance of IRepository against the specific DataModel type and provide standard CRUD operation only.
    /// </summary>
    /// <typeparam name="T">The specific DataModel type.</typeparam>
    public abstract class RepositoryBase<T> where T : DataModelBase
    {
        protected CachaloteContext DataContext;

        /// <summary>
        /// Just need to make sure every sub-class has a contructor accpets ISession parameter.
        /// </summary>
        /// <param name="session">An instance implements ISession.</param>
        public RepositoryBase(CachaloteContext dataContext)
        {
            DataContext = dataContext;
        }
    }
}
